package cmd

import (
	"gitee.com/flyspace81/secure-cli/base"
	"github.com/spf13/cobra"
	_ "io/ioutil"
)

const helloAnalysisUrbancsoSecure = `
解析奇安星城的资产漏洞分析报告    secure ubs -w dir
`

func NewCmdAnalysisUrbancsoSecure() *cobra.Command {
	cmd := &cobra.Command{
		Use:   "ubs",
		Short: "解析奇安星城的资产漏洞分析报告",
		Long:  `解析奇安星城的资产漏洞分析报告`,
		Run: func(cmd *cobra.Command, args []string) {
			if global.WorkDir != "" {
				base.Cxt.Println(global.WorkDir)
			} else {
				cmd.HelpFunc()(cmd, args)
			}
		},
	}

	cmd.Flags().StringVarP(&global.WorkDir, "workdir", "w", global.WorkDir, "working directory")
	cmd.SetHelpTemplate(helpTmpl)
	cmd.SetUsageTemplate(usageTmpl)
	resetHelpFunc(cmd)

	base.Cxt.Println(global.WorkDir)
	return cmd
}

func printhelloAnalysisUrbancsoSecure() {
	base.Cxt.Println(helloAnalysisUrbancsoSecure)
}
